A computer includes a central processing unit (CPU) and devices that are interconnected through a system bus (hereinafter also referred to as “bus”), and the device is accessed by an instruction of a program running on the CPU. Access to the device is called “input/output processing” or “I/O processing”. On the other hand, software that controls the devices is called “operating system (OS)”. Software that controls a device in particular in the OS is called a “device driver”. Further, a plurality of user programs are executed on the OS under control of the OS. In order to prevent direct access by the user program to the device, the user program is given an execution permission different from the execution permission of the OS.
Examples of CPUs include Xeon (registered trademark) and Atom (registered trademark) from Intel Corporation. Meanwhile, examples of OSs include Windows (registered trademark) from Microsoft Corporation and Linux (registered trademark). Further, examples of system buses include PCI (Peripheral Component Interconnect) and PCI-Express. Moreover, examples of devices include an HDD (hard disk drive) and a NIC (network interface card).
Devices are scanned by a BIOS (Basic Input/Output System) during boot-up of a computer, and identifiers (IDs) and memory areas are allocated to the devices. At this point of time, the devices are not available. After startup of the OS, device drivers for the devices that are compatible with the OS among the scanned devices initialize the devices. As a result, the devices are made available.
There are two known methods for the running OS to access a device: access by issuing an I/O instruction and access by MMIO (Memory-Mapped I/O). In the former method, I/O instructions are defined as an instruction set for the CPU. A program issues a CPU instruction to output an I/O request onto the bus, thereby accomplishing access to the device. In the latter method, on the other hand, when the OS accesses a particular memory address, the CPU or a chipset that controls the bus converts the access to I/O processing and outputs the I/O processing to the bus, thereby accomplishing access to the device. Because the BIOS allocates a memory space size requested by a device to a physical memory space when the BIOS scans the device as mentioned above, memory access to the allocated physical memory space is substituted with an I/O request. Hereinafter, the two methods of device access will be collectively referred to as “I/O instruction”. When a device is accessed, an ID identifying the device (such as a memory address and an ID of a slot to which the device is inserted) is specified in the I/O instruction.
Formerly, a single OS has been running on a CPU because performance of the single CPU has been insufficient. Recently, however, some amount of software overhead will be accepted because of improved performance of a CPU. This improvement enables a plurality of virtual hardware environments to run on a single CPU by virtualizing hardware.
FIG. 15 is a block diagram illustrating an exemplary configuration of such a virtual computer. An OS that manages a virtual hardware environment as illustrated in FIG. 15 is referred to as a host OS 104. An OS running in a virtual hardware environment, on the other hand, is referred to as a guest OS 108. While it is possible to run only a single host OS 104, it is possible to run a plurality of guest OSs 108. Guest OSs 108 may be of a type different from the type of the host OS 104, and guest OSs 108 may be of types different from one another. Known examples of host OSs 104 that provide a virtual hardware environment include Kernel-based Virtual Machine (KVM) and VMware (registered trademark) and ESXi server from VMWare, Inc.
In a virtual environment, in general, a virtualized device A (hereinafter referred to as “virtual device”) 106 is provided to a guest OS 108 instead of the guest OS 108 directly recognizing a device B 103 connected to the host OS 104. In other words, a device driver B 105 held by the host OS 104 controls the device B 103. A device driver A 109 held by the guest OS 108, on the other hand, controls the virtual device A 106. In this case, an I/O instruction issued by the device driver A 109 held by the guest OS 108 is converted in the host OS 104 so that a device driver of the device B103 can interpret the I/O instruction.
Meanwhile, PTL 1 discloses a “pass-through technique” in which a device is managed by a device driver held by a guest OS instead of a host OS. According to the technique described in PTL 1, some of the devices connected to the computer can be controlled by the guest OS, in place of the host OS.
Further, PTL 2 discloses a technique that virtually extends a bus. According to the technique described in PTL 2, a distance between a CPU and a device can be physically extended by transferring data on a PCI-Express bus to a network such as the Ethernet (registered trademark). On the PCI-Express bus, data are transferred in a form of packets. A packet is a transfer unit for performing communication between two points, and typically source and target addresses are contained in the packet.
FIG. 16 is a block diagram illustrating an exemplary configuration of a computer to which the bus extension technique described in PTL 2 is applied. Referring to FIG. 16, according to the technique described in PTL 2, an upstream bridge 202 is provided on the CPU 201 side and a downstream bridge 400 is provided on a device (a peripheral device 500) side. The bridges 202 and 400 encapsulate or decapsulate (i.e. remove capsulation of) packets. The encapsulation enables data to flow from a bus to an Ethernet network. Since the Ethernet transfers data in packets, a packet flowing through a network will be hereinafter referred to as “network packet”.
In addition, PTL 3 describes a technique in which, when data are sent from a PC (personal computer) to a printer connected to the PC via a network, a printer driver generates a control command in accordance with an access request that occurs on the PC, an USB (Universal Serial Bus) printer class driver converts the control command to a USB packet, and the network protocol layer sends the USB packet to a device server as a network packet.
PTL 4 also describes a technique in which a virtualization bridge performs only management being common to I/O devices and a system manager connected via a network performs processing that is dependent on individual I/O devices by using software provided by individual manufacturers.
Moreover, PTL 5 describes a technique for providing an arrangement that separates an input/output device from a host computer system apparatus and connects the input/output device to the system apparatus so that the input/output device is dynamically connected to the host computer system.